
<script language="javascript">

	message_form = "<form method='post' id='message_form'>";
	message_form += "<input type='hidden' name='id' id='id' value=''>";
	message_form += "<input type='hidden' name='fid' id='fid' value='{$CURRENT_USER->userid}'>";
	message_form += "<input type='hidden' name='type' id='type' value=''>";
	message_form += "<table border='0' cellpadding='0' cellspacing='0'>";
	message_form += "<tr id='mailfield' style='display: none;'><td>{$lang.mail}</td><td><input type='text' class='txt' name='replyto' id='replyto' size='20'/></td></tr>";
	message_form += "<tr><td valign='top'>{$lang.message}</td><td valign='top'><textarea class='txt' name='message' id='message' rows='4' cols='20' wrap='virtual'></textarea></td></tr>";
	message_form += "<tr><td>&nbsp;</td><td align='right'><input type='button' value='{$lang.sendmp}' name='{$lang.sendmp}' onClick='sendMessage()' class='button'></td></tr></table>";

	function openMessage(e,id,type) {ldelim}
		
		messagewindow = new Poat({ldelim}width: 300{rdelim});
		messagewindow.event = e;
		messagewindow.result = message_form;
		messagewindow.name = "message_window";
		messagewindow.response("");
	
		var forma = document.getElementById("message_form");
		
		if (type=="adm") {ldelim}
			document.getElementById('mailfield').style.display="";
			forma.replyto.value="";
			forma.replyto.focus();
		{rdelim}

		forma.id.value=id;
		forma.type.value=type;

	{rdelim}
	
	function sendMessage() {ldelim}
		showprogress();
		xajax_sendMessage(xajax.getFormValues("message_form"));
		WindowControl.destroy("message_window");
	{rdelim}
	
</script>